package org.gwc.error;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "error")
public class ErrorController {

    // 创造空指针异常
    @GetMapping(value = "data")
    public String data(){
        String s = null;
        return s.toString();
    }

    // 创造除0异常
    @GetMapping(value = "data1")
    public String data1(){
        int i = 1/0;
        return "1/0";
    }
}
